

public class Erase extends Thread{
	private boolean active;
	private String mask;

	public Erase(){
		this('*');

	}

	public Erase(char maskChar){
		active=true;
		mask="\010"+maskChar;

	}

	public void setActive(boolean active){
		this.active=active;

	}


	public boolean isActive(){
		return active;
	}

	public void run(){
		while(isActive()){
			System.out.print(mask);
			try{
				Thread.currentThread().sleep(500);
			}
			catch(InterruptedException e){
				e.printStackTrace();
			}
		}
	}


}


